package com.cq.hd.member.mapper;

import com.cq.hd.member.api.dto.AgentPageDto;
import com.cq.hd.member.api.dto.AppUserPageDto;
import com.cq.hd.member.api.vo.AgentPageVo;
import com.cq.hd.member.api.vo.AppUserPageVo;
import com.cq.hd.member.api.vo.AppUserVo;
import com.cq.hd.member.po.TbAppUserPo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * app用户表 Mapper 接口
 * </p>
 *
 * @author mYunYu
 * @since 2023-11-21
 */
@Mapper
public interface TbAppUserMapper extends BaseMapper<TbAppUserPo> {

    List<AppUserPageVo> listAppUserByDto(AppUserPageDto appUserPageDto);

    List<AgentPageVo> listAgentByDto(AgentPageDto agentPageDto);

    List<AppUserVo> listByUserIds(@Param("userIds") List<Long> userIds);

    Boolean addCommissionAmt(@Param("userId") Long userId, @Param("commissionAmt") BigDecimal commissionAmt);

    Boolean subCommissionAmt(@Param("userId") Long userId, @Param("commissionAmt") BigDecimal commissionAmt);

    Boolean updateUnionidById(@Param("userId") Long userId, @Param("unionid") String unionid);

    AppUserVo getByUnionid(@Param("unionid") String unionid);

    AppUserVo getByOpenId(@Param("openId") String openId);

    AppUserVo getByInviteCode(@Param("inviteCode") String inviteCode);
}
